
*********************************
***   For appendix: balance   ***
*********************************

replace religion = "" if religion == "Unkown" | religion == "Unknown"
gen christian = 0 if religion != ""
replace christian = 1 if religion == "Christian"

gen muslim = 0 if religion != ""
replace muslim = 1 if religion == "Muslim"

gen other = 0 if religion != ""
replace other = 1 if religion == "Traditional" | religion == "Other" | religion == "None"

drop french_lang diola_lang other_lang

local placebo age christian muslim other *_lang
est clear 

foreach var of varlist `placebo' {
	
	display " "
	display " "
	display " "
	display "Table A8: `var'"
	
	quietly eststo: areg `var' i.birthyear_control i.year_survey_control post1 treat2_10_inc urbrur2 instrument if birthyear_control >= 1970 & birthyear_control <= 1997, absorb(locale_gender) cluster(locale_3_control)
	
	noisily: lincom instrument
	quietly: summ `var'
	estadd scalar vmean = r(mean)
}


local numbers "& (1) & (2) & (3) & (4) \\"
local panelA "\textbf{Panel A:} & \multicolumn{1}{c}{Respondent age} &  \multicolumn{1}{c}{Christian}  &  \multicolumn{1}{c}{Muslim}  &  \multicolumn{1}{c}{Other religions} \\  \midrule"
local panelB "\midrule \\ \textbf{Panel B:} & \multicolumn{1}{c}{Wolof (lang)} &  \multicolumn{1}{c}{Touc/Peul (lang)}  &  \multicolumn{1}{c}{Serer (lang)}  &  \multicolumn{1}{c}{Mandinka (lang)} \\  \midrule"
local gap ""

esttab est1 est2 est3 est4 using "tables/balance.tex", replace b(3) se(3) ar(3) ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) nonumber posthead("`numbers'" "`panelA'") ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(instrument)

esttab est5 est6 est7 est8 using "tables/balance.tex", b(3) se(3) ar(3) ///
stats(N vmean, fmt(0 3 3 "") labels(`"Observations"' `"DV Mean"')) ///
nonumber posthead("`gap'" "`panelB'") append ///
f label nomtitles nogaps booktabs noobs compress star(* 0.10 ** 0.05 *** 0.01) keep(instrument)

